package com.zzy.face.model;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;

/**
 * @Author 朱泽玉
 * @Create 2022/1/29 10:14
 * @Description 账号
 * @Modified By:
 */
@Data
@Entity
public class Account {
    @Id
    @JsonSerialize(using = ToStringSerializer.class)
    private Long uid;

    /*手机号码*/
    private String mobile;

    /*密码采用加密算法*/
    private String password;

    /*账号身份，学生：0，教师：1，管理员：2*/
    private int Identity;

    /*账号状态，已验证：2，未验证：1，未查看*/
    private int state;

    private String birthday;

    private String idNumber;

    /*创建时间*/
    private String date_time;

    private String name;

    private String sex;

    private String college;

    /*对应学生或者教师或者管理员*/
    @OneToOne(mappedBy = "account")
    private Admin admin;

    @OneToOne(mappedBy = "account")
    private Student student;

    @OneToOne(mappedBy = "account")
    private Teacher teacher;
}
